/**
 * @author yusak
 */
ChaShaKu.InputAnalyze = Ext.extend(Ext.app.Module,{
	id: 'inputAnalyze',
	run: function(){
		this.app.modules.advancedSearchPanel.afterRenderedModules.push(this);
	},
	create: function(){
		var text = this.app.viewport.field.getValue();
		if(text.length != 0){
			var grid = this.app.modules.advancedSearchPanel.grid;
			var ds = grid.getStore();
			var data = {keywords:[]}
			text.strip().split(/\s|　/).each(function(word){
				if(word.length != 0){
					data.keywords.push({surface:word,interval:0});
				}
			});
			ds.loadData(data,true);
		}
	}
});
